{$CLEO .cs}

//-------------MAIN---------------
0000:nop
wait 1100
:PUT_ACTOR
jump @BALL_ZONE_OBJECT_1
 wait 0
 if
00E1: key_pressed 0 4 //TAB
else_jump @PUT_ACTOR
//5@ = #SPEEDER // 1-
//gosub @LOAD_new_Object_1
//car.Create(0@,5@,2502.9277, -1676.1393, 13.3655)
//wait 1000
//car.RemoveReferences(0@)
//model.Destroy(5@)
  actor.PutAt($PLAYER_ACTOR,528.1559, -1765.3612, 14.2822)
  
//=======================================
//=======================================    .
//=======================================



:BALL_ZONE_OBJECT_1
wait 0
if 
 //00FE:   actor $PLAYER_ACTOR sphere 0 in_sphere 2494.3987 -1700.739 1014.7422 radius 30.0 30.0 10.0
 00FE:   actor $PLAYER_ACTOR sphere 0 in_sphere 528.4741 -1760.3584 14.2769 radius 50.0 50.0 15.0
 else_jump @BALL_ZONE_OBJECT_1
  0A40: 1@ = create_entrance_marker_at 528.4741 -1760.3584 14.9769 color 3
marker.CreateIconAndSphere(2@,9,528.4741, -1760.3584, 14.2769)
marker.SetColor(1@,3) //-   
wait 1000
 //=======================================
:ENTER_SHOP_BUY_ACTOR_1
wait 0
if
00FE:   actor $PLAYER_ACTOR sphere 0 in_sphere 528.4741 -1760.3584 14.2769 radius 2.0 2.0 15.0
else_jump @ENTER_SHOP_BUY_ACTOR_2
 0A41: destroy_entrance_marker 1@
 marker.Disable(2@)
 jump @CREAT_SHOP_BUY_BICH
 
 :ENTER_SHOP_BUY_ACTOR_2
 wait 0
if
 80FE:   not actor $PLAYER_ACTOR sphere 0 in_sphere 528.4741 -1760.3584 14.2769 radius 60.0 60.0 15.0
 else_jump @ENTER_SHOP_BUY_ACTOR_1
  0A41: destroy_entrance_marker 1@
  marker.Disable(2@)
  jump @BALL_ZONE_OBJECT_1
 //========================================
 :CREAT_SHOP_BUY_BICH
//===================================
$ONMISSION = 1
0180: set_on_mission_flag_to $ONMISSION
21@ = 533.4741    
22@ = -1758.0
23@ = 13.50
5@ = 18007 
gosub @LOAD_new_Object_1
object.Create(4@,5@,21@, 22@, 23@)   //
5@ = 18092 
gosub @LOAD_new_Object_1
object.Create(7@,5@,21@, 22@, 23@)  //
5@ = 1500 
gosub @LOAD_new_Object_1
object.Create(6@,5@,21@, 22@, 23@)  //
0177: set_object 4@ Z_angle_to 169.0
069A: attach_object 7@ to_object 4@ at_offset 0.0 -2.0 -1.70 rotation 0.0 0.0 180.0  //
069A: attach_object 6@ to_object 4@ at_offset -3.0 -2.50 -2.10 rotation 0.0 0.0 180.0 //
//=============================   ==================
wait 0
0400: store_coords_to 21@ 22@ 23@ from_object 7@ with_offset 0.0 -1.0 -0.50
0376: 11@ = create_random_actor 21@ 22@ 23@
0400: store_coords_to 21@ 22@ 23@ from_object 7@ with_offset 0.0 0.0 0.50
5@ = 1008 
gosub @LOAD_new_Object_1
object.Create(3@,1008,21@, 22@, 23@)//
object.RemoveReferences(3@)
0400: store_coords_to 21@ 22@ 23@ from_object 7@ with_offset 0.0 0.50 0.50
object.Create(2@,1008,21@, 22@, 23@)//
wait 0
//069A: attach_object 2@ to_object 3@ at_offset 0.15 0.0 0.0 rotation 0.0 0.0 0.0 //
0639: AS_actor 11@ rotate_to_actor $PLAYER_ACTOR
0400: store_coords_to 21@ 22@ 23@ from_object 6@ with_offset -2.0 1.0 0.0 
actor.PutAt($PLAYER_ACTOR,21@, 22@, 23@)
model.Destroy(1008)  //
model.Destroy(18007)//
model.Destroy(18092) //
model.Destroy(1500) //
wait 0
0400: store_coords_to 21@ 22@ 23@ from_object 6@ with_offset 0.0 1.0 0.90
0A40: 9@ = create_entrance_marker_at 21@ 22@ 23@ color 4     
//0605: actor 11@ perform_animation_sequence "IDLE_chat" from_file "PED" 4.0 loop 1 0 0 1 -1 ms
//06A8: AS_actor $PLAYER_ACTOR run_to_and_look_at_actor 11@ timelimit 2000 approach_distance 0.5 approach_angle 90.0 
wait 0
 //=====================================
5@ = 1598  //
gosub @LOAD_new_Object_1
//04C4: create_coordinate 21@ 22@ 23@ from_actor $PLAYER_ACTOR offset 1.0 1.0 -1.0
Object.Create(1@,1598,531.8975, -1755.1593, 14.6846) //
model.Destroy(5@)
20@ = 0 //

5@ = 2779 
gosub @LOAD_new_Object_1
0400: store_coords_to 21@ 22@ 23@ from_object 7@ with_offset -6.70 -1.40 -0.5
Object.Create(12@,2779,21@, 22@, 23@) // 
0453: object 12@ set_rotation 0.0 0.0 160.0
model.Destroy(5@)

5@ = 2410  //Ѹ
gosub @LOAD_new_Object_1
24@ = -3.30 

:SHOP_STENA_OBVES_1
wait 0
0400: store_coords_to 21@ 22@ 23@ from_object 4@ with_offset 24@ -4.60 -0.80
Object.Create(13@,5@,21@, 22@, 23@) //Ѩ
0453: object 13@ set_rotation 180.0 -100.0 100.0
0382: set_object 13@ collision_detection 0  
object.RemoveReferences(13@)
24@ += 1.0
if
  24@ > 6.0
  else_jump @SHOP_STENA_OBVES_1   
model.Destroy(5@)

5@ = 2404  //Ѹ
gosub @LOAD_new_Object_1
24@ = -3.80 

:SHOP_STENA_OBVES_2
wait 0
0400: store_coords_to 21@ 22@ 23@ from_object 4@ with_offset 24@ -4.60 -1.70
Object.Create(13@,5@,21@, 22@, 23@) //Ѩ
0453: object 13@ set_rotation 0.0 0.0 0.0
0382: set_object 13@ collision_detection 0  
object.RemoveReferences(13@)
24@ += 1.0
if
  24@ > 6.0
  else_jump @SHOP_STENA_OBVES_2     
model.Destroy(5@)

5@ = 2405  //Ѹ
gosub @LOAD_new_Object_1
24@ = -3.80 

:SHOP_STENA_OBVES_3
wait 0
0400: store_coords_to 21@ 22@ 23@ from_object 4@ with_offset 24@ -3.90 0.30
Object.Create(13@,5@,21@, 22@, 23@) //Ѩ
0453: object 13@ set_rotation 60.0 0.0 0.0
0382: set_object 13@ collision_detection 0  
object.RemoveReferences(13@)
24@ += 1.0
if
  24@ > 6.0
  else_jump @SHOP_STENA_OBVES_3     
model.Destroy(5@)

5@ = 2406  //Ѹ
gosub @LOAD_new_Object_1
24@ = 3.0 

:SHOP_STENA_OBVES_4
wait 0
0400: store_coords_to 21@ 22@ 23@ from_object 4@ with_offset 24@ -0.30 -2.0
Object.Create(13@,5@,21@, 22@, 23@) //Ѩ
0453: object 13@ set_rotation 0.0 0.0 140.0
0382: set_object 13@ collision_detection 0  
object.RemoveReferences(13@)
24@ += 0.50
if
  24@ > 6.0
  else_jump @SHOP_STENA_OBVES_4     
model.Destroy(5@)

5@ = 1640  //
gosub @LOAD_new_Object_1
24@ = -0.50 

:SHOP_STENA_OBVES_5
wait 0
0400: store_coords_to 21@ 22@ 23@ from_object 4@ with_offset -2.40 24@ -0.50
Object.Create(13@,5@,21@, 22@, 23@) // 
0453: object 13@ set_rotation 90.0 330.0 -90.0
0382: set_object 13@ collision_detection 0
08D2: object 13@ scale_model 0.8   
object.RemoveReferences(13@)
24@ -= 0.50
5@ += 1  //
gosub @LOAD_new_Object_1
if
 // 24@ <= -2.30
 5@ >= 1644
  else_jump @SHOP_STENA_OBVES_5     
model.Destroy(5@)

5@ = 2362
gosub @LOAD_new_Object_1
0400: store_coords_to 21@ 22@ 23@ from_object 4@ with_offset -1.70 -2.0 -1.20
Object.Create(13@,2362,21@, 22@, 23@) //
0453: object 13@ set_rotation 0.0 0.0 180.0
object.RemoveReferences(13@)
0400: store_coords_to 21@ 22@ 23@ from_object 4@ with_offset -1.0 -2.0 -1.20
Object.Create(13@,2362,21@, 22@, 23@) //
0453: object 13@ set_rotation 0.0 0.0 180.0
object.RemoveReferences(13@)
model.Destroy(5@)

5@ = 1514
gosub @LOAD_new_Object_1
0400: store_coords_to 21@ 22@ 23@ from_object 4@ with_offset -1.80 -1.60 -1.20
Object.Create(13@,5@,21@, 22@, 23@) //
0453: object 13@ set_rotation 0.0 0.0 -260.0
object.RemoveReferences(13@)
model.Destroy(5@)

5@ = 2484
gosub @LOAD_new_Object_1
24@ = -1.70 

:SHOP_STENA_OBVES_6
wait 0
0400: store_coords_to 21@ 22@ 23@ from_object 4@ with_offset 24@ -1.0 0.60
Object.Create(13@,2484,21@, 22@, 23@) //
0453: object 13@ set_rotation 0.0 0.0 320.0
08D2: object 13@ scale_model 0.7   
object.RemoveReferences(13@)
24@ += 1.0
if
 24@ >= 6.0
 else_jump @SHOP_STENA_OBVES_6
model.Destroy(5@)

5@ = 1575
//gosub @LOAD_new_Object_1
24@ = -2.40 


:SHOP_STENA_OBVES_7
wait 0
gosub @LOAD_new_Object_1
0400: store_coords_to 21@ 22@ 23@ from_object 4@ with_offset 7.0 -2.40 24@
Object.Create(13@,5@,21@, 22@, 23@) //  
0453: object 13@ set_rotation 0.0 0.0 0.0
//08D2: object 13@ scale_model 0.7   
object.RemoveReferences(13@)
24@ += 0.15
model.Destroy(5@)
5@ += 1  
if
  5@ >= 1581
else_jump @SHOP_STENA_OBVES_7
model.Destroy(5@)
5@ = 1575
gosub @LOAD_new_Object_1
if
 24@ >= 0.0
 else_jump @SHOP_STENA_OBVES_7
model.Destroy(5@)


5@ = 1579
gosub @LOAD_new_Object_1
0400: store_coords_to 21@ 22@ 23@ from_object 4@ with_offset 6.90 -2.50 -1.20
Object.Create(3@,5@,21@, 22@, 23@) //
0453: object 3@ set_rotation 0.0 0.0 0.0
model.Destroy(5@)

0390: load_txd_dictionary "MALIBU"  // TXD  -        
038F: request_texture "BALLBICH" as  10
038F: request_texture "AKVALANG" as  11  // -        
038F: request_texture "POLATENEC" as  12  // -        
038F: request_texture "UDO4KA" as  13  // -        
wait 0


:SHOP_BUY_TOBAP_1
03F0: text_draw_toggle  0 //     
wait 0
if and
 not 20@ == 1
 0471: unknown_actor $PLAYER_ACTOR near_object 1@ radius 0.80 0.80 unknown 0
 else_jump @SHOP_BUY_TOBAP_2
 038D: create_texture  10 position  160.0  350.0 scale  100.0  100.0 color  255  255  255 alpha 255
 if and
  not 20@ == 1
  not 20@ == 2
  not 20@ == 3
  00E1: key_pressed 0 11 //YES
  else_jump @SHOP_BUY_TOBAP_1
object.Destroy(1@)
5@ = 1598 
gosub @LOAD_new_Object_1
04C4: create_coordinate 21@ 22@ 23@ from_actor $PLAYER_ACTOR offset 0.0 0.0 -2.50
Object.Create(1@,1598,21@, 22@, 23@) //
069B: attach_object 1@ to_actor $PLAYER_ACTOR at_offset 0.0 0.50 -0.60 rotation 0.0 0.0 0.0
model.Destroy(5@)
21@ = actor.Angle($PLAYER_ACTOR)
20@ = 1
wait 1000
  jump @SHOP_BUY_TOBAP_2
  
  :SHOP_BUY_TOBAP_2
03F0: text_draw_toggle  0 //     
wait 0
if and
 not 20@ == 2
 0471: unknown_actor $PLAYER_ACTOR near_object 2@ radius 0.80 0.80 unknown 0
 else_jump @SHOP_BUY_TOBAP_3
 038D: create_texture  11 position  160.0  350.0 scale  110.0  110.0 color  255  255  255 alpha 255
 if and
  not 20@ == 2
  not 20@ == 1
  not 20@ == 3
  00E1: key_pressed 0 11 //YES
  else_jump @SHOP_BUY_TOBAP_2
object.Destroy(2@)
5@ = 1008 
gosub @LOAD_new_Object_1
04C4: create_coordinate 21@ 22@ 23@ from_actor $PLAYER_ACTOR offset 0.0 0.0 -2.50
Object.Create(2@,1008,21@, 22@, 23@) //
21@ = actor.Angle($PLAYER_ACTOR)
21@ += 90.0
0453: object 2@ set_rotation 90.0 0.0 21@
070A: AS_actor $PLAYER_ACTOR attach_to_object 2@ offset 0.0 0.02 -0.30 on_bone 6 0 perform_animation "NULL" IFP_file "NULL" time 1
model.Destroy(5@)
20@ = 2
wait 1000
  jump @SHOP_BUY_TOBAP_2
  
  :SHOP_BUY_TOBAP_3
03F0: text_draw_toggle  0 //     
wait 0
if and
 not 20@ == 3
 0471: unknown_actor $PLAYER_ACTOR near_object 3@ radius 0.80 0.80 unknown 0
 else_jump @SHOP_BUY_TOBAP_5
 038D: create_texture  12 position  160.0  350.0 scale  110.0  110.0 color  255  255  255 alpha 255
 if and
  not 20@ == 2
  not 20@ == 1
  not 20@ == 3
  00E1: key_pressed 0 11 //YES
  else_jump @SHOP_BUY_TOBAP_3
object.Destroy(3@)
5@ = 1576 //
gosub @LOAD_new_Object_1
04C4: create_coordinate 21@ 22@ 23@ from_actor $PLAYER_ACTOR offset 0.0 0.0 -2.50
Object.Create(3@,5@,21@, 22@, 23@) //
21@ = actor.Angle($PLAYER_ACTOR)
21@ += 90.0
0453: object 3@ set_rotation 90.0 0.0 21@
070A: AS_actor $PLAYER_ACTOR attach_to_object 3@ offset 0.0 0.02 -0.30 on_bone 6 0 perform_animation "NULL" IFP_file "NULL" time 1
model.Destroy(5@)
20@ = 3
wait 1000
  jump @SHOP_BUY_TOBAP_2
 
 :SHOP_BUY_TOBAP_5 //
wait 0
if or
 actor.Dead($PLAYER_ACTOR)
 8471: not unknown_actor $PLAYER_ACTOR near_object 6@ radius 30.0 30.0 unknown 0
 0471: unknown_actor $PLAYER_ACTOR near_object 6@ radius 1.0 1.0 unknown 0
 else_jump @SHOP_BUY_TOBAP_1
 wait 1000
 jump @EXIT_SHOP

:EXIT_SHOP
actor.PutAt($PLAYER_ACTOR,527.6732, -1763.3018, 13.70)
 object.Destroy(1@)//BALL
 object.Destroy(2@) //AKVALANG
object.Destroy(3@) //
object.Destroy(4@)//  
object.Destroy(7@)//
object.Destroy(6@)//  

object.Destroy(12@)// 
Actor.DestroyInstantly(11@)
0A41: destroy_entrance_marker 9@
03F0: text_draw_toggle  0 //     
wait 0
0391: release_txd_dictionary //  TXD'
$ONMISSION = 0
0180: set_on_mission_flag_to $ONMISSION

:BUY_SHOP_OBJECT_1// 
if
  20@ == 2
else_jump @BUY_SHOP_OBJECT_2
5@ = 1008 
gosub @LOAD_new_Object_1
04C4: create_coordinate 21@ 22@ 23@ from_actor $PLAYER_ACTOR offset 0.0 0.0 -2.50
Object.Create(2@,1008,21@, 22@, 23@) //
21@ = actor.Angle($PLAYER_ACTOR)
21@ += 90.0
0453: object 2@ set_rotation 90.0 0.0 21@
070A: AS_actor $PLAYER_ACTOR attach_to_object 2@ offset 0.0 0.02 -0.30 on_bone 6 0 perform_animation "NULL" IFP_file "NULL" time 1
model.Destroy(5@)
wait 1000
jump @AKVALANG_WATER_1

:BUY_SHOP_OBJECT_2// 
if
  20@ == 3
else_jump @BUY_SHOP_OBJECT_3
20@ = 1640   // 
19@ = 2843 //  
5@ = 1576 //
gosub @LOAD_new_Object_1
04C4: create_coordinate 21@ 22@ 23@ from_actor $PLAYER_ACTOR offset 0.0 0.0 -2.50
Object.Create(2@,5@,21@, 22@, 23@) //
21@ = actor.Angle($PLAYER_ACTOR)
21@ += 90.0
0453: object 2@ set_rotation 90.0 0.0 21@
070A: AS_actor $PLAYER_ACTOR attach_to_object 2@ offset 0.0 0.02 -0.30 on_bone 6 0 perform_animation "NULL" IFP_file "NULL" time 1
model.Destroy(5@)
jump @POLOTENEC_RUKA_1


:BUY_SHOP_OBJECT_3// 
if
  20@ == 1
else_jump @BALL_ZONE_OBJECT_1
5@ = 1598 
gosub @LOAD_new_Object_1
04C4: create_coordinate 21@ 22@ 23@ from_actor $PLAYER_ACTOR offset 0.0 0.0 -2.50
Object.Create(1@,1598,21@, 22@, 23@) //
069B: attach_object 1@ to_actor $PLAYER_ACTOR at_offset 0.0 0.50 -0.60 rotation 0.0 0.0 0.0
model.Destroy(5@)
21@ = actor.Angle($PLAYER_ACTOR)
20@ = 1
wait 1000
jump @BALL_PICKUP_OBJECT_1
//============================================================
//===================  =====================
//============================================================
:POLOTENEC_PICKUP_1
 wait 0
if and
0471: unknown_actor $PLAYER_ACTOR near_object 2@ radius 1.0 1.0 unknown 0
00E1: key_pressed 0 4 //TAB
else_jump @POLOTENEC_PICKUP_2
object.Destroy(2@)
5@ = 1579 //
gosub @LOAD_new_Object_1
04C4: create_coordinate 21@ 22@ 23@ from_actor $PLAYER_ACTOR offset 0.0 0.0 -2.50
Object.Create(2@,5@,21@, 22@, 23@) //
21@ = actor.Angle($PLAYER_ACTOR)
21@ += 90.0
0453: object 2@ set_rotation 90.0 0.0 21@
070A: AS_actor $PLAYER_ACTOR attach_to_object 2@ offset 0.0 0.02 -0.30 on_bone 6 0 perform_animation "NULL" IFP_file "NULL" time 1
model.Destroy(5@)
wait 1000
jump @POLOTENEC_RUKA_1

:POLOTENEC_PICKUP_2
wait 0
if
8471: not unknown_actor $PLAYER_ACTOR near_object 2@ radius 50.0 50.0 unknown 0
else_jump @POLOTENEC_PICKUP_1
 object.Destroy(2@)
 wait 1000
 jump @BALL_ZONE_OBJECT_1
//================================================================
 //===============================================
 //=================  ================
 //===============================================
  :POLOTENEC_ATACH_CAR_1
 wait 0
  0AB5: store_actor $PLAYER_ACTOR closest_vehicle_to 0@ closest_ped_to 1@
   if
   056E: 0@
  else_jump @POLOTENEC_ATACH_CAR_2
  //04C4: store_coords_to 21@ 22@ 23@ from_actor $PLAYER_ACTOR with_offset 0.0 1.0 0.0 
   if
    0202:   actor $PLAYER_ACTOR near_car 0@ radius 4.0 4.0 flag 0 
   else_jump @POLOTENEC_ATACH_CAR_2
   object.Destroy(2@)
  5@ = 1579 
  gosub @LOAD_new_Object_1
  04C4: create_coordinate 21@ 22@ 23@ from_actor $PLAYER_ACTOR offset 0.0 0.0 -5.60
  Object.Create(2@,5@,21@, 22@, 23@) // 
  0681: attach_object 2@ to_car 0@ at_offset  0.75 0.30 -0.20 rotation 0.0 0.0 90.0
  model.Destroy(5@)
  return
  
  :POLOTENEC_ATACH_CAR_2
  //gosub @ANIMATION_Copbrowse
  //0605: actor $PLAYER_ACTOR perform_animation_sequence "Copbrowse_nod" from_file "COP_AMBIENT" 4.0 loop 0 0 0 0 -1 ms
  //wait 3000
  object.Destroy(2@)  
  5@ = 1579 
  gosub @LOAD_new_Object_1
   04C4: create_coordinate 21@ 22@ 23@ from_actor $PLAYER_ACTOR offset 0.30 0.30 -1.20
  Object.Create(2@,5@,21@, 22@, 23@) //
  21@ = actor.Angle($PLAYER_ACTOR)
  21@ += 90.0
  0453: object 2@ set_rotation 0.0 0.0 21@
  model.Destroy(5@)
  return
//========================================
  :POLOTENEC_RUKA_1
wait 0
if and
00E1: key_pressed 0 15 //ENTER CAR
not actor.Driving($PLAYER_ACTOR) //
else_jump @POLOTENEC_RUKA_2
gosub @POLOTENEC_ATACH_CAR_1
wait 1000
jump @POLOTENEC_PICKUP_1

:POLOTENEC_RUKA_2
wait 0
if and
00E1: key_pressed 0 4 //TAB
not actor.Driving($PLAYER_ACTOR) //

else_jump @POLOTENEC_RUKA_1
object.Destroy(2@)
gosub @ANIM_POLOTENEC_1
//5@ = 2843
0085: 5@ = 19@
gosub @LOAD_new_Object_1
04C4: create_coordinate 21@ 22@ 23@ from_actor $PLAYER_ACTOR offset 0.50 0.0 -0.98
Object.Create(3@,5@,21@, 22@, 23@) //
21@ = actor.Angle($PLAYER_ACTOR)
0453: object 3@ set_rotation 0.0 0.0 21@
model.Destroy(5@)

0085: 5@ = 20@ // (int) 
//5@ = 1640 
gosub @LOAD_new_Object_1
04C4: create_coordinate 21@ 22@ 23@ from_actor $PLAYER_ACTOR offset 0.0 0.0 -0.98
Object.Create(2@,5@,21@, 22@, 23@) //
21@ = actor.Angle($PLAYER_ACTOR)
0453: object 2@ set_rotation 0.0 0.0 21@
model.Destroy(5@)
0615: define_action_sequences 21@ //  
//0605: actor -1 perform_animation_sequence "batherdown" from_file "SUNBATHE" 4.0 loop 0 0 0 0 -1 ms
//0605: actor -1 perform_animation_sequence "ParkSit_W_in" from_file "SUNBATHE" 4.0 loop 0 0 0 0 -1 ms
0605: actor -1 perform_animation_sequence "ParkSit_M_IdleA" from_file "SUNBATHE" 4.0 loop 0 0 0 0 -1 ms
0605: actor -1 perform_animation_sequence "ParkSit_M_IdleB" from_file "SUNBATHE" 4.0 loop 0 0 0 0 -1 ms
0605: actor -1 perform_animation_sequence "ParkSit_M_IdleC" from_file "SUNBATHE" 4.0 loop 0 0 0 0 -1 ms
0605: actor -1 perform_animation_sequence "Lay_Bac_in" from_file "SUNBATHE" 4.0 loop 0 0 0 1 -1 ms
//0605: actor -1 perform_animation_sequence "SitnWait_in_W" from_file "SUNBATHE" 4.0 loop 1 0 0 1 -1 ms
//0605: actor -1 perform_animation_sequence "ParkSit_M_IdleB" from_file "SUNBATHE" 4.0 loop 0 0 0 0 -1 ms 
0616: define_action_sequences_end 21@ //  
0618: assign_actor $Player_actor to_action_sequences 21@
061B: remove_references_to_action_sequences 21@
0793: save_player_clothes 
wait 0
//Player.SetClothes($PLAYER_CHAR, "boxingcap", "boxingcap", 16)//
Player.SetClothes($PLAYER_CHAR, "player_legs", "legs", 2) //
//Player.SetClothes($PLAYER_CHAR, "legsblack", "legs", 2) //    suit1trblk  suit1tr 
Player.SetClothes($PLAYER_CHAR, "foot", "feet", 3) //
Player.SetClothes($PLAYER_CHAR, "player_torso", "torso", 0) //
Player.Build($PLAYER_CHAR)
22@ = 0.0
20@ += 1
19@ += 1//
if
20@ >= 1644
else_jump  @POLOTENEC_ZAGAR_1
20@ = 1640
19@ = 2819
wait 1000
jump @POLOTENEC_ZAGAR_1
//================================
:POLOTENEC_ZAGAR_1
wait 0
if or
 04AD: actor $PLAYER_ACTOR touching_water
 actor.Dead($PLAYER_ACTOR)
 00E1: key_pressed 0 15 //ENTER CAR
else_jump @POLOTENEC_ZAGAR_2
Object.Destroy(3@)
0605: actor $PLAYER_ACTOR perform_animation_sequence "ParkSit_M_out" from_file "SUNBATHE" 4.0 loop 0 0 0 0 -1 ms
wait 1000
0794: restore_player_clothes 
Player.Build($PLAYER_CHAR)
jump @POLOTENEC_PICKUP_1

:POLOTENEC_ZAGAR_2
0494: get_joystick 0 data 28@ 29@ 30@ 31@ 
if
0 > 28@
else_jump @POLOTENEC_ZAGAR_3
21@ = object.Angle(2@)
22@ -= 1.0
0453: object 2@ set_rotation 22@ 0.0 21@
jump @POLOTENEC_ZAGAR_1

:POLOTENEC_ZAGAR_3
0494: get_joystick 0 data 28@ 29@ 30@ 31@ 
if
0 < 28@
else_jump @POLOTENEC_ZAGAR_1
21@ = object.Angle(2@)
22@ += 1.0
0453: object 2@ set_rotation 22@ 0.0 21@
jump @POLOTENEC_ZAGAR_1
  //==============================
   :ANIM_POLOTENEC_1
   wait 0
04ED: load_animation "SUNBATHE" 
if
 04EE: animation "SUNBATHE" loaded
 else_jump @ANIM_POLOTENEC_1
  return
 


//============================================================
//===================  =====================
//============================================================
:AKVALANG_PICKUP_1
 wait 0
if and
0471: unknown_actor $PLAYER_ACTOR near_object 2@ radius 1.0 1.0 unknown 0
00E1: key_pressed 0 4 //TAB
else_jump @AKVALANG_PICKUP_2
object.Destroy(2@)
5@ = 1008 
gosub @LOAD_new_Object_1
04C4: create_coordinate 21@ 22@ 23@ from_actor $PLAYER_ACTOR offset 0.0 0.0 -2.50
Object.Create(2@,1008,21@, 22@, 23@) //
21@ = actor.Angle($PLAYER_ACTOR)
21@ += 90.0
0453: object 2@ set_rotation 90.0 0.0 21@
070A: AS_actor $PLAYER_ACTOR attach_to_object 2@ offset 0.0 0.02 -0.30 on_bone 6 0 perform_animation "NULL" IFP_file "NULL" time 1
model.Destroy(5@)
wait 1000
jump @AKVALANG_WATER_1

:AKVALANG_PICKUP_2
wait 0
if
8471: not unknown_actor $PLAYER_ACTOR near_object 2@ radius 50.0 50.0 unknown 0
else_jump @AKVALANG_PICKUP_1
 object.Destroy(2@)
 wait 1000
 jump @BALL_ZONE_OBJECT_1
//================================================================
 //===============================================
 //=================  ================
 //===============================================
  :AKVALANG_ATACH_CAR_1
 wait 0
  0AB5: store_actor $PLAYER_ACTOR closest_vehicle_to 0@ closest_ped_to 1@
   if
   056E: 0@
  else_jump @AKVALANG_ATACH_CAR_2
  //04C4: store_coords_to 21@ 22@ 23@ from_actor $PLAYER_ACTOR with_offset 0.0 1.0 0.0 
   if
    0202:   actor $PLAYER_ACTOR near_car 0@ radius 4.0 4.0 flag 0 
   else_jump @AKVALANG_ATACH_CAR_2
   object.Destroy(2@)
  5@ = 1008 
  gosub @LOAD_new_Object_1
  04C4: create_coordinate 21@ 22@ 23@ from_actor $PLAYER_ACTOR offset 0.0 0.0 -5.60
  Object.Create(2@,1008,21@, 22@, 23@) // 
    0681: attach_object 2@ to_car 0@ at_offset  0.65 0.0 -0.10 rotation 90.0 0.0 180.0
  // gosub @WAIT_CAR_MODEL_01d //  
  return
  
  :AKVALANG_ATACH_CAR_2
  gosub @ANIMATION_Copbrowse
  0605: actor $PLAYER_ACTOR perform_animation_sequence "Copbrowse_nod" from_file "COP_AMBIENT" 4.0 loop 0 0 0 0 -1 ms
  wait 3000
  object.Destroy(2@)  
  5@ = 1008 
  gosub @LOAD_new_Object_1
   04C4: create_coordinate 21@ 22@ 23@ from_actor $PLAYER_ACTOR offset 0.30 0.30 -1.0
  Object.Create(2@,1008,21@, 22@, 23@) //
  21@ = actor.Angle($PLAYER_ACTOR)
  21@ += 90.0
  0453: object 2@ set_rotation 90.0 90.0 21@
  return
//========================================
  :AKVALANG_WATER_1  // 
wait 0
//21@ += 1.0
//069B: attach_object 2@ to_actor $PLAYER_ACTOR at_offset 0.0 0.50 -0.60 rotation 21@ 21@ 21@
if and
00E1: key_pressed 0 15 //ENTER CAR
not actor.Driving($PLAYER_ACTOR) //
else_jump @AKVALANG_WATER_2
gosub @AKVALANG_ATACH_CAR_1
wait 1000
jump @AKVALANG_PICKUP_1

:AKVALANG_WATER_2   // 
wait 0
if and
00E1: key_pressed 0 4 //TAB
//04AD: actor $PLAYER_ACTOR touching_water 
not actor.Driving($PLAYER_ACTOR) //
else_jump @AKVALANG_WATER_3
$ONMISSION = 1
0180: set_on_mission_flag_to $ONMISSION
object.Destroy(2@)
0793: save_player_clothes 
gosub @ANIMATION_CLOSEST
0605: actor $PLAYER_ACTOR perform_animation_sequence "CLO_Pose_Torso" from_file "CLOTHES" 4.0 loop 0 0 0 0 -1 ms
wait 1000
Player.SetClothes($PLAYER_CHAR, "boxingcap", "boxingcap", 16)//
//Player.SetClothes($PLAYER_CHAR, "player_legs", "legs", 2) //
Player.SetClothes($PLAYER_CHAR, "legsblack", "legs", 2) //    suit1trblk  suit1tr 
Player.SetClothes($PLAYER_CHAR, "foot", "feet", 3) //
Player.SetClothes($PLAYER_CHAR, "player_torso", "torso", 0) //
Player.Build($PLAYER_CHAR)
04D8: set_actor $PLAYER_ACTOR drowns_in_water 0 //     
//$Timer = 248000//248000 //    
//014E: set_timer_to $Timer type 1 //     ""
0390: load_txd_dictionary "MALIBU"  // TXD  -        
038F: request_texture "VOZDUH" as  1  // -        
038F: request_texture "STRELKA" as  2
wait 1000
if
//04AD: actor $PLAYER_ACTOR touching_water//   
0965: actor $PLAYER_ACTOR swimming_in_water // 
else_jump @AKVALANG_VOZDUH
23@ = 30.0
jump @AKVALANG_WATER_www1

:AKVALANG_VOZDUH
gosub @ANIMATION_Copbrowse
0605: actor $PLAYER_ACTOR perform_animation_sequence "Copbrowse_nod" from_file "COP_AMBIENT" 4.0 loop 0 0 0 0 -1 ms
wait 2000
0669: 21@ = attach_particle "extinguisher" to_actor $PLAYER_ACTOR offset 0.05 0.0 0.1 1

//066D: 21@ = attach_particle "extinguisher" to_object 2@ offset 0.1 0.2 0.3 1
23@ = 320.0
064C: make_particle 21@ visible
wait 1000
0650: destroy_particle 21@
jump @AKVALANG_WATER_www1

:AKVALANG_WATER_3
wait 0
if 
  actor.Dead($PLAYER_ACTOR)
  else_jump @AKVALANG_WATER_1
  object.Destroy(2@)
  jump @BALL_ZONE_OBJECT_1
  //=============================
   :ANIMATION_CLOSEST
   wait 0
04ED: load_animation "CLOTHES" 
if
 04EE: animation "CLOTHES" loaded
 else_jump @ANIMATION_CLOSEST
  return
  :ANIMATION_Copbrowse
    wait 0
04ED: load_animation "COP_AMBIENT" 
if
 04EE: animation "COP_AMBIENT" loaded
 else_jump @ANIMATION_Copbrowse
  return
//=================================================
 :AKVALANG_WATER_www1
 03F0: text_draw_toggle  0 //     
 wait 0
if or
//$Timer < 1 
00E1: key_pressed 0 15 //ENTERCAR
actor.Dead($PLAYER_ACTOR)
else_jump @AKVALANG_WATER_www2
$ONMISSION = 0
0180: set_on_mission_flag_to $ONMISSION

04D8: set_actor $PLAYER_ACTOR drowns_in_water 1 //      
0794: restore_player_clothes 
Player.Build($PLAYER_CHAR)
5@ = 1008 
gosub @LOAD_new_Object_1
04C4: create_coordinate 21@ 22@ 23@ from_actor $PLAYER_ACTOR offset 0.0 0.0 -2.50
Object.Create(2@,1008,21@, 22@, 23@) //
21@ = actor.Angle($PLAYER_ACTOR)
21@ -= 90.0
0453: object 2@ set_rotation 0.0 0.0 21@
070A: AS_actor $PLAYER_ACTOR attach_to_object 2@ offset 0.0 0.02 -0.30 on_bone 6 0 perform_animation "NULL" IFP_file "NULL" time 1
model.Destroy(5@)

066D: 21@ = attach_particle "extinguisher" to_object 2@ offset -0.3 0.0 0.0 1
064C: make_particle 21@ visible

03F0: text_draw_toggle  0 //     
wait 1000
0650: destroy_particle 21@
0391: release_txd_dictionary //  TXD'
jump @AKVALANG_WATER_1

:AKVALANG_WATER_www2
038D: create_texture  1 position  160.0  400.0 scale  150.0  150.0 color  255  255  255 alpha 255 //    ( ,    )
074B: draw_texture 2 position 130.0 371.0 scale 70.0 70.0 angle 23@ color_RGBA 255 255 255 255 -    .
23@ -= 0.05
if
23@ <= 30.0
else_jump @AKVALANG_WATER_www1
23@ = 30.0
04D8: set_actor $PLAYER_ACTOR drowns_in_water 1 //      
jump @AKVALANG_WATER_www1
//============================================================
//===================  ===========================
//============================================================
:BALL_PICKUP_OBJECT_1
wait 0
if and
0471: unknown_actor $PLAYER_ACTOR near_object 1@ radius 1.0 1.0 unknown 0
00E1: key_pressed 0 4 //TAB
else_jump @BALL_PICKUP_OBJECT_2
object.Destroy(1@)
5@ = 1598 
gosub @LOAD_new_Object_1
04C4: create_coordinate 21@ 22@ 23@ from_actor $PLAYER_ACTOR offset 0.0 0.0 -2.50
Object.Create(1@,1598,21@, 22@, 23@) //
069B: attach_object 1@ to_actor $PLAYER_ACTOR at_offset 0.0 0.50 -0.60 rotation 0.0 0.0 0.0
model.Destroy(5@)
21@ = actor.Angle($PLAYER_ACTOR)
wait 1000
jump @VOLEBALL_START_1

:BALL_PICKUP_OBJECT_2
wait 0
if
8471: not unknown_actor $PLAYER_ACTOR near_object 1@ radius 50.0 50.0 unknown 0
else_jump @BALL_PICKUP_OBJECT_1
 object.Destroy(1@)
 wait 1000
 jump @BALL_ZONE_OBJECT_1
 //===============================================
 //=================  ================
 //===============================================
  :BALL_ATACH_CAR_1
 wait 0
  0AB5: store_actor $PLAYER_ACTOR closest_vehicle_to 0@ closest_ped_to 1@
   if
   056E: 0@
  else_jump @BALL_ATACH_CAR_2
  //04C4: store_coords_to 21@ 22@ 23@ from_actor $PLAYER_ACTOR with_offset 0.0 1.0 0.0 
   if
    0202:   actor $PLAYER_ACTOR near_car 0@ radius 4.0 4.0 flag 0 
   else_jump @BALL_ATACH_CAR_2
  5@ = 1598 
  gosub @LOAD_new_Object_1
  04C4: create_coordinate 21@ 22@ 23@ from_actor $PLAYER_ACTOR offset 0.0 0.0 -5.60
  Object.Create(1@,1598,21@, 22@, 23@) //
    0681: attach_object 1@ to_car 0@ at_offset  0.60 -0.45 -0.10 rotation 90.0 0.0 180.0
  // gosub @WAIT_CAR_MODEL_01d //  
  return
  
  :BALL_ATACH_CAR_2
  5@ = 1598 
  gosub @LOAD_new_Object_1
  04C4: create_coordinate 21@ 22@ 23@ from_actor $PLAYER_ACTOR offset 1.0 0.0 -1.0
  Object.Create(1@,1598,21@, 22@, 23@) //
  return
 //=============================================
 //=========  =========================
:VOLEBALL_START_0
wait 0
21@ += 1.0
069B: attach_object 1@ to_actor $PLAYER_ACTOR at_offset 0.0 0.50 -0.60 rotation 21@ 21@ 21@
if and
00E1: key_pressed 0 15 //ENTER CAR
not actor.Driving($PLAYER_ACTOR) //
else_jump @VOLEBALL_START_1
object.Destroy(1@)
gosub @BALL_ATACH_CAR_1
wait 1000
jump @BALL_PICKUP_OBJECT_1

:VOLEBALL_START_1
wait 0
if and
00E1: key_pressed 0 4 //TAB
not actor.Driving($PLAYER_ACTOR) //
else_jump @VOLEBALL_START_0
object.Destroy(1@)
//01b6: set_weather 1// 
5@ = 1598
gosub @LOAD_new_Object_1
04C4: create_coordinate 21@ 22@ 23@ from_actor $PLAYER_ACTOR offset -3.0 3.0 -0.50
Object.Create(1@,1598,21@, 22@, 23@) //
model.Destroy(5@)
0382: set_object 1@ collision_detection 0 
0392: object 1@ toggle_in_moving_list 0 

5@ = 1639
gosub @LOAD_new_Object_1
04C4: create_coordinate 21@ 22@ 23@ from_actor $PLAYER_ACTOR offset 0.0 5.0 -1.10
Object.Create(2@,1639,21@, 22@, 23@) //C
21@ = actor.Angle($PLAYER_ACTOR)
object.Angle(2@) = 21@
model.Destroy(5@)
wait 1000
5@ = 1668
gosub @LOAD_new_Object_1
0400: store_coords_to 21@ 22@ 23@ from_object 2@ with_offset -3.0 5.0 0.10
Object.Create(4@,1668,21@, 22@, 23@) //1668-

0400: store_coords_to 21@ 22@ 23@ from_object 2@ with_offset 0.0 7.0  0.10
Object.Create(6@,1668,21@, 22@, 23@)
object.RemoveReferences(6@)
0400: store_coords_to 21@ 22@ 23@ from_object 2@ with_offset -6.0 7.0  0.10
Object.Create(6@,1668,21@, 22@, 23@)
object.RemoveReferences(6@)

0400: store_coords_to 21@ 22@ 23@ from_object 2@ with_offset 0.0 -7.0  0.10
Object.Create(6@,1668,21@, 22@, 23@)
object.RemoveReferences(6@)
0400: store_coords_to 21@ 22@ 23@ from_object 2@ with_offset -6.0 -7.0  0.10
Object.Create(6@,1668,21@, 22@, 23@)
object.RemoveReferences(6@)
model.Destroy(5@)

0400: store_coords_to 21@ 22@ 23@ from_object 2@ with_offset -3.0 8.0  0.10
0376: 3@ = create_random_actor 21@ 22@ 23@ //

04C4: create_coordinate 21@ 22@ 25@ from_actor $PLAYER_ACTOR offset 0.0 0.0 -0.50 // 
//wait 3000
//29@ = 0.0 //
//29@ += 100.0


:BALL_PUSH_1
wait 0
if or
0471: unknown_actor 3@ near_object 1@ radius 1.0 1.0 unknown 0
00E1: key_pressed 0 17
else_jump @BALL_PUSH_2
0639: AS_actor 3@ rotate_to_actor $PLAYER_ACTOR 
0605: actor 3@ perform_animation_sequence "BBALL_Jump_Shot" from_file "BSKTBALL" 4.0 loop 0 0 0 0 -1 ms 
wait 1500
21@ = actor.Angle(3@)
object.Angle(1@) = 21@
actor.StorePos(3@,21@,22@,23@)
23@ += 3.0
jump @BALL_FLY_1


 :BALL_PUSH_2
 wait 0
 if 
 0471: unknown_actor $PLAYER_ACTOR near_object 1@ radius 1.0 1.0 unknown 0
 else_jump @BALL_PUSH_3
 gosub @LOAD_ANIM_VALLEYBALL
 0400: store_coords_to 21@ 22@ 23@ from_object 1@ with_offset 0.0 0.1 0.10
0605: actor $PLAYER_ACTOR perform_animation_sequence "BBALL_Jump_Shot" from_file "BSKTBALL" 4.0 loop 0 0 0 0 -1 ms 
 :BALL_ANIM_1 
 21@ = actor.Angle($PLAYER_ACTOR)
 object.Angle(1@) = 21@
 04C4: create_coordinate 21@ 22@ 24@ from_actor $PLAYER_ACTOR offset 0.0 0.0 3.0
 29@ = 0.0
 jump @BALL_FLY_1
 
 :BALL_PUSH_3   //     
0400: store_coords_to 21@ 22@ 23@ from_object 2@ with_offset 0.0 -7.0  0.0
0400: store_coords_to 31@ 32@ 33@ from_object 2@ with_offset -6.0 7.0  6.0
if     // 
  84EA:   not object 1@ in_cube_cornerA 21@ 22@ 23@ cornerB 31@ 32@ 33@ flag 0 
  else_jump @BALL_PUSH_4
0400: store_coords_to 21@ 22@ 23@ from_object 2@ with_offset -3.0 -4.0  0.50  
object.PutAt(1@,21@, 22@, 23@)
wait 500
jump @BALL_PUSH_1 

  :BALL_PUSH_4  //EXIT GAME
  if or
  actor.Dead(3@)
  8471: not unknown_actor $PLAYER_ACTOR near_object 2@ radius 30.0 30.0 unknown 0
  00E1: key_pressed 0 15 //ENTER CAR
  else_jump @BALL_PUSH_1
  actor.RemoveReferences(3@)
  object.Destroy(1@)
  object.Destroy(2@)
  object.Destroy(4@)
5@ = 1598 
gosub @LOAD_new_Object_1
04C4: create_coordinate 21@ 22@ 23@ from_actor $PLAYER_ACTOR offset 1.0 1.0 -0.50
Object.Create(1@,1598,21@, 22@, 23@) //
  jump @BALL_PICKUP_OBJECT_1
 //===================================================== 
  
:BALL_FLY_1
wait 0
0400: store_coords_to 21@ 22@ 23@ from_object 1@ with_offset 0.0 0.1 0.10
object.PutAt(1@,21@, 22@, 23@)

if
 0025:   23@ > 24@ // (float) 
else_jump @BALL_FLY_1
06E2: AS_actor 3@ run_to_object 1@ timelimit 3000 stop_within_radius 0.40

 :BALL_FLY_2  //
wait 0
0400: store_coords_to 21@ 22@ 23@ from_object 1@ with_offset 0.0 0.1 -0.10
object.PutAt(1@,21@, 22@, 23@)
object.StorePos(1@,21@, 22@, 23@)
if
 0025:   25@ >= 23@ // (float) 
else_jump @BALL_FLY_3
06E2: AS_actor 3@ run_to_object 4@ timelimit 3000 stop_within_radius 0.40
0400: store_coords_to 21@ 22@ 23@ from_object 2@ with_offset -0.20 0.0 0.0
0400: store_coords_to 31@ 32@ 33@ from_object 2@ with_offset -6.0 7.0 6.0
if     //    
 04EA:   object 1@ in_cube_cornerA 21@ 22@ 23@ cornerB 31@ 32@ 33@ flag 0  
else_jump @BALL_PUSH_1
06E2: AS_actor 3@ run_to_object 1@ timelimit 5000 stop_within_radius 0.40 
jump @BALL_PUSH_1

:BALL_FLY_3   // 
if
0471: unknown_actor 3@ near_object 1@ radius 1.50 1.50 unknown 0
else_jump @BALL_FLY_4
gosub @LOAD_ANIM_VALLEYBALL
 21@ = object.Angle(2@)
 21@ -= 180.0
 actor.Angle(3@) = 21@
0605: actor 3@ perform_animation_sequence "BBALL_Jump_Shot" from_file "BSKTBALL" 4.0 loop 0 0 0 0 -1 ms 
 04C4: create_coordinate 21@ 22@ 23@ from_actor 3@ offset 0.0 0.50 1.0
 object.PutAt(1@,21@, 22@, 23@)
21@ = actor.Angle(3@)
object.Angle(1@) = 21@
25@ += 0.50
jump @DOWN_BALL_ACTOR_2

:BALL_FLY_4   //cj 
if
0471: unknown_actor $PLAYER_ACTOR near_object 1@ radius 0.40 0.40 unknown 0
else_jump @BALL_FLY_2

0605: actor $PLAYER_ACTOR perform_animation_sequence "BBALL_Jump_Shot" from_file "BSKTBALL" 4.0 loop 0 0 0 0 -1 ms
21@ = actor.Angle($PLAYER_ACTOR)
object.Angle(1@) = 21@
25@ += 0.50     
jump @DOWN_BALL_ACTOR_1

:BALL_FLY_5  //  
wait 0
0400: store_coords_to 21@ 22@ 23@ from_object 1@ with_offset 0.0 0.1 0.10
object.PutAt(1@,21@, 22@, 23@)
if
 0025:   23@ > 24@ // (float) 
else_jump @BALL_FLY_5
jump @BALL_FLY_2
//================================
///       
:DOWN_BALL_ACTOR_2
wait 0
0400: store_coords_to 21@ 22@ 23@ from_object 1@ with_offset 0.0 0.08 -0.20
object.PutAt(1@,21@, 22@, 23@)
object.StorePos(1@,21@, 22@, 23@)
if
 0025:   25@ >= 23@ // (float) 
else_jump @DOWN_BALL_ACTOR_2
25@ -= 0.50
jump @BALL_FLY_5

:DOWN_BALL_ACTOR_1
wait 0
0400: store_coords_to 21@ 22@ 23@ from_object 1@ with_offset 0.0 0.1 -0.20
object.PutAt(1@,21@, 22@, 23@)
object.StorePos(1@,21@, 22@, 23@)
if
 0025:   25@ >= 23@ // (float) 
else_jump @DOWN_BALL_ACTOR_1
06E2: AS_actor 3@ run_to_object 4@ timelimit 3000 stop_within_radius 0.40
25@ -= 0.50
jump @BALL_FLY_1



//==========================
//==========================
//==========================
   :LOAD_ANIM_VALLEYBALL
   wait 0
04ED: load_animation "BSKTBALL" 
if
 04EE: animation "BSKTBALL" loaded
 else_jump @LOAD_ANIM_VALLEYBALL
  return
//===========================================
:LOAD_new_Object_1
 Model.Load(5@)  
 038B: load_requested_models 
 
 :LOAD_new_Object_2
 wait 0
 if
  model.Available(5@)
  else_jump @LOAD_new_Object_2
  return

























